After the reader presses the button below, I'll prompt the user to say hello.
function doHello(msg) { var ans = prompt(""+msg,"Hello"); if (!ans) alert("You pressed cancel.") else if (ans.toUpperCase() == "HELLO") alert("You said hello!") else alert("You didn't say hello...") }